Skip to content

Conversation

@cwperks
Copy link
Member

@cwperks cwperks commented Oct 14, 2025

Description

This PR contains changes to the ResourceAccessControlClient to start to refer to resourceType everywhere instead of resourceIndex. Currently, the repo assumes a 1-to-1 relationship between resource type and index, but this should be relaxed to allow multiple resource types in a single index (think dashboards saved objects).

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Enhancement

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

cwperks and others added 30 commits September 25, 2025 22:16
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
… as protected and fixes share api action to throw 400 on resources not marked as protected

Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
…ad-safe in resource-plugin-info class

Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
@cwperks
Copy link
Member Author

cwperks commented Oct 14, 2025

I plan to add new integration tests...either in this PR or another that add a second resource type (sample-resource-group) and keep records in the same index as sample-resource and then run through different scenarios for sharing.

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 61.71171% with 170 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.89%. Comparing base (2dcde2e) to head (4b3d8da).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ava/org/opensearch/sample/SampleResourceGroup.java 0.00% 28 Missing ⚠️
...i/migrate/MigrateResourceSharingInfoApiAction.java 56.41% 11 Missing and 6 partials ⚠️
...ons/transport/GetResourceGroupTransportAction.java 48.38% 14 Missing and 2 partials ⚠️
.../transport/CreateResourceGroupTransportAction.java 75.00% 11 Missing and 3 partials ⚠️
...arch/security/resources/ResourceAccessHandler.java 56.00% 8 Missing and 3 partials ⚠️
.../transport/DeleteResourceGroupTransportAction.java 63.63% 6 Missing and 2 partials ⚠️
...ctions/rest/create/CreateResourceGroupRequest.java 46.15% 7 Missing ⚠️
...ctions/rest/create/UpdateResourceGroupRequest.java 58.82% 7 Missing ⚠️
...ons/rest/search/SearchResourceGroupRestAction.java 30.00% 7 Missing ⚠️
.../transport/UpdateResourceGroupTransportAction.java 77.77% 5 Missing and 1 partial ⚠️
... and 14 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5713      +/-   ##
==========================================
- Coverage   73.14%   72.89%   -0.26%     
==========================================
  Files         412      435      +23     
  Lines       26167    26548     +381     
  Branches     3963     3979      +16     
==========================================
+ Hits        19141    19351     +210     
- Misses       5139     5286     +147     
- Partials     1887     1911      +24     
Files with missing lines Coverage Δ
...pensearch/sample/SampleResourceGroupExtension.java 100.00% <100.00%> (ø)
...va/org/opensearch/sample/SampleResourcePlugin.java 96.87% <100.00%> (+1.22%) ⬆️
...actions/rest/create/CreateResourceGroupAction.java 100.00% <100.00%> (ø)
...actions/rest/create/UpdateResourceGroupAction.java 100.00% <100.00%> (ø)
...actions/rest/delete/DeleteResourceGroupAction.java 100.00% <100.00%> (ø)
...group/actions/rest/get/GetResourceGroupAction.java 100.00% <100.00%> (ø)
...p/actions/rest/get/GetResourceGroupRestAction.java 100.00% <100.00%> (ø)
...actions/rest/search/SearchResourceGroupAction.java 100.00% <100.00%> (ø)
...in/java/org/opensearch/sample/utils/Constants.java 0.00% <ø> (ø)
.../opensearch/security/OpenSearchSecurityPlugin.java 85.39% <ø> (ø)
... and 29 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be good addition to this new framework and will setup a path to implement linux-style ACLs to allow hierarchical access authorization.

I have left a few comments. PR looks good mostly otherwise.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for addressing the comments. left a final few. Will approve once addressed.

@cwperks cwperks merged commit aa8629e into opensearch-project:main Oct 21, 2025
66 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants